home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / bltpxtab.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  81 lines

  1. #include "bltpxtab.h"
  2.  
  3. BlockTPXTable::BlockTPXTable(rect coordinates,
  4.            char* tabName,
  5.            char* fName,
  6.            char* h,
  7.            int s,
  8.            BORDERS b_type,
  9.            BORDERS hdr_b_type,
  10.            int res,
  11.            int hdr_pat,
  12.            int elem_pat,
  13.            int fNo,
  14.            char** fields,
  15.            char** types)
  16.     : BlockPXTable(coordinates, tabName, fName, h, s, b_type,
  17.            hdr_b_type, res, hdr_pat, elem_pat, fNo, fields, types)
  18.     {
  19.     int xl = coordinates.origin.X + 1;
  20.     int yt = coordinates.corner.Y - 3;
  21.     int yb = coordinates.corner.Y - 2;
  22.  
  23.     f_first_button = new Button(rect(xl + 13, yt, xl + 24, yb),
  24.     "Find First", BUTTON_BORDER, elem_pat);
  25.     f_next_button = new Button(rect(xl + 13, yt + 1, xl + 24, yb + 1),
  26.     "Find Next", BUTTON_BORDER, elem_pat);
  27.     rotate_button = new Button(rect(xl + 24, yt, xl + 31, yb),
  28.     "Rotate", BUTTON_BORDER, elem_pat);
  29.     edit_button = new Button(rect(xl + 24, yt + 1, xl + 31, yb + 1),
  30.     "Edit", BUTTON_BORDER, elem_pat);
  31.  
  32.     add(f_first_button);
  33.     add(f_next_button);
  34.     add(rotate_button);
  35.     add(edit_button);
  36.  
  37.     assign(table, f_first_button, AC_FIND_FIRST);
  38.     assign(table, f_next_button, AC_FIND_NEXT);
  39.     assign(table, rotate_button, AC_NEXT);
  40.     assign(table, edit_button, AC_EDIT);
  41.     }
  42. /////////////////////////////////
  43. void BlockTPXTable::rearrange()
  44.     {
  45.     BlockPXTable::rearrange();
  46.     rect r;
  47.     rect coord = textRect(r = w1->bound());
  48.  
  49.     int xl = coord.origin.X + 1;
  50.     int yt = coord.corner.Y - 3;
  51.     int yb = coord.corner.Y - 2;
  52.  
  53.     f_first_button->repose(rect(xl + 13, yt, xl + 24, yb));
  54.     f_next_button->repose(rect(xl + 13, yt + 1, xl + 24, yb + 1));
  55.     rotate_button->repose(rect(xl + 24, yt, xl + 31, yb));
  56.     edit_button->repose(rect(xl + 24, yt + 1, xl + 31, yb + 1));
  57.     }
  58. /////////////////////////
  59. /*
  60. void main()
  61.     {
  62.     if(!init_KNOW_HOW())
  63.     return;
  64.     if(PXInit() != PXSUCCESS)
  65.     return;
  66.  
  67.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  68.     bar(0, 0, getmaxx(), getmaxy());
  69.  
  70.     BlockTPXTable w(rect(10, 2, 78, 18), "demo.db", "window.pcy",
  71.     " KNOW-HOW 4.x", 3, SHOW_BORDER, SHOW_BORDER, MOVE | RESIZE, 19, 0);
  72.  
  73.     w.show_window();
  74.     w.exe();
  75.     w.hide();
  76.  
  77.     PXExit();
  78.     close_KNOW_HOW();
  79.     closegraph();
  80.     }
  81. */